<template>
    <div>

        <el-dialog title="确认打款给用户" :visible.sync="dialogVisible" @close="closeEdit(false)" width="800px">
            <el-form :model="memberForm" ref="memberForm" label-width="120px" style="width: 90%;">

                <el-row :gutter="40">
                    <el-col :span="24">
                        <el-form-item
                                label="状态">
                            <el-radio-group v-model="status">
                                <el-radio :label="1">{{statusText}}</el-radio>
                            </el-radio-group>
                        </el-form-item>
                    </el-col>
                </el-row>
            </el-form>

            <div slot="footer" class="dialog-footer">
                <el-button @click="closeEdit(false)">取 消</el-button>
                <SubmitButton v-if="checkYes == 1" type="primary" size=""
                              :ref-form="()=>{return this.$refs['memberForm']}"
                              :post-option="{url: checkPassUrl, data: memberForm, callback: checkCB }">
                    确认已打款
                </SubmitButton>
                <!--<SubmitButton v-if="checkYes == 0" type="primary" size=""
                              :ref-form="()=>{return this.$refs['memberForm']}"
                              :post-option="{url: checkFailUrl, data: memberForm, callback: checkCB }">
                    不打款
                </SubmitButton>-->
            </div>

        </el-dialog>

    </div>

</template>


<script>

    import SubmitButton from '../common/SubmitButton'

    import CommonApi from '../../api/CommonApi'
    import OrderApi from '../../api/OrderApi'


    export default {
        components: {
            SubmitButton
        },
        data() {
            return {

                status: 1,
                statusText: '',

                memberForm: {
                    id: '',
                    remark: '',
                },

                checkPassUrl: OrderApi.URL_REFUND_ORDER_TRANSFER,
            }
        },
        props: ['isShow', 'memberObj', 'checkYes'],
        computed: {
            dialogVisible: {
                get: function () {
                    return this.isShow;
                },
                set: function (val) {
                }
            }
        },
        watch: {
            dialogVisible: function (newVal, oldVal) {
                this.memberForm.id = this.memberObj.id;
                this.statusText = '确认已打款给用户';
            }
        },
        created() {
        },
        methods: {
            checkCB(json) {
                this.closeEdit(true);
            },
            closeEdit(isSuccess) {
                this.$refs['memberForm'].resetFields();
                this.$root.eventHub.$emit('closeEditDialog', isSuccess);
            }
        }
    }
</script>

